﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace Microsoft.AspNet.Identity
{

    public static class IdentityResultExtensions
    {

        public static string[] ToErrorStrings(this IdentityResult result)
        {
            var errorStrs = result.Errors?.Select(x => $"Error Code: {x.Code}, Description: {x.Description}.").ToArray() ?? new string[] { };
            return errorStrs;
        }

    }

}